package com.mycompany.dewcineplanet.repository;

import java.util.ArrayList;
import java.util.List;

import com.mycompany.dewcineplanet.model.Cliente;

public class ClienteRepository {

	List<Cliente> list = null;

	public ClienteRepository(){
		list = new ArrayList<Cliente>();
		list.add(new Cliente(1,"Jhon","Conor","Bustamante"));
		list.add(new Cliente(2,"Julio","Cesar","Quispe"));
		list.add(new Cliente(3,"Arturo","Bonifaz","Contreras"));
		list.add(new Cliente(4,"Erick","Sanchez","Uriarte"));
		list.add(new Cliente(5,"Carlos","Bonilla","Perez"));		
	}

	public List<Cliente> obtenerTodosClientes() {
		return list;
	}

	public boolean validarCliente(Long cliente){
		boolean flag = false;
		if(cliente != null){
			if(list != null && list.size() > 0){
				for(int i = 0; i < list.size(); i++){
					if(list.get(i).getCodigo().equals(cliente)){
						flag = true;
						break;
					}
				}
			}
		}
		return flag;
	}
}
